Repository navigation
Add Reset filters button to empty search results - #106136
Conversation
Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
|
Pushed c4b1882 to fix the Oxfmt check: reformatted EmptySearchViewTest.tsx, with no behavior changes.
New CI checks are pending. The independent-approval requirement still needs human review. |
|
🤖 Web test steps verification results: Verified on dev NewDot web; Expenses empty/reset behavior passes after creating ordinary test data. The tester reached its step limit; narrow layout, offline reset, and console inspection remain unverified.
view run · no recording available |
|
|
|
@MelvinBot Please update Tests
Offline testsN/A. apply filters offline showing offline screen. QA StepsSame as Tests step PR Author ChecklistMark all author checklist checked |
|
@MelvinBot Mark this PR ready for review |
|
Updated the PR description with your six Tests steps, offline note, and “Same as Tests steps” for QA. Checked all PR Author Checklist boxes on your behalf, with a note distinguishing this from AI verification. No tests were rerun. |
|
@ahmedGaber93 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Marked Add Reset filters button to empty search results ready for review. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| ...button, | ||
| buttonText: translate(button.buttonText), | ||
| })), | ||
| children: menuItem.emptyState.title === 'search.searchResults.emptyResults.title' ? <SearchResetFiltersButton /> : undefined, |
There was a problem hiding this comment.
❌ CONSISTENCY-18 (docs)
This branch injects the reset button only when the menu item's emptyState.title happens to equal the generic empty-results translation key. Why the reset action is gated on the title key matching that exact value is not recoverable from the code, so the next contributor has to reverse-engineer the intent (and will not know this breaks silently if another emptyState later reuses that title).
Add a short comment stating the reason, e.g.:
// Only the generic "no results" empty state (identified by its shared title key) represents a filtered
// search that can be reset, so that is the only menu-provided state that gets the reset button.
children: menuItem.emptyState.title === 'search.searchResults.emptyResults.title' ? <SearchResetFiltersButton /> : undefined,Reviewed at: c4b1882 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
| ...button, | ||
| buttonText: translate(button.buttonText), | ||
| })), | ||
| children: menuItem.emptyState.title === 'search.searchResults.emptyResults.title' ? <SearchResetFiltersButton /> : undefined, |
There was a problem hiding this comment.
❌ CONSISTENCY-2 (docs)
The translation key 'search.searchResults.emptyResults.title' is hardcoded here as a discriminator and is also repeated in getEmptyResultsContent on line 215. A bare literal used as a comparison value is easy to desync: if the key is ever renamed, this condition silently stops matching and the reset button disappears with no error.
Extract the key to a shared named constant (or compare against the same identifier getEmptyResultsContent builds from) so there is a single source of truth, e.g.:
const EMPTY_RESULTS_TITLE_KEY = 'search.searchResults.emptyResults.title';
// ...
children: menuItem.emptyState.title === EMPTY_RESULTS_TITLE_KEY ? <SearchResetFiltersButton /> : undefined,Reviewed at: c4b1882 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
@MelvinBot add an explicit flag (e.g. shouldShowResetFilters) to the menu item’s emptyState definition, set only where it applies (Insights, etc.), and check that flag instead of the title.
There was a problem hiding this comment.
🤖 Web test steps verification results: ❌ fail
Pushed 1140010: added optional shouldShowResetFilters metadata, enabled it for Insights, and replaced the title comparison; 44 regression/hook tests, typecheck, full lint, Storybook smoke test, and staged follow-up review passed. Web verification was blocked by a blank page with zero accessible nodes; full Jest and compiler checks timed out, changed-file checks lacked Git history, and formatter checks were unavailable/denied (details recorded under AI Tests).
| Step | Status |
|---|---|
| ❌ | |
Unfiltered empty/onboarding view retains existing actions without Reset filtersBlocked prerequisite: no empty-view or onboarding UI was available. A blank page does not establish the expected absence of Reset filters. |
❌ |
view run · no recording available
Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
|
|
|
🚧 dubielzyk-expensify has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
Testing well to me 👍 |
|
@ahmedGaber93 conflicts |
|
@MelvinBot please fix the confilct. |
Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
|
🚧 JS00001 has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.5.36-0 🚀
|
|
No help site update needed — this adds a shortcut to the existing filter-reset action without introducing a new workflow or making any existing article inaccurate. |
|
No FullStory changes needed. The new Reset filters button already supplies the stable identifier |
|
@MelvinBot Could you please confirm whether the Reset Filter button should be green, as shown in the initial step, or grey, as mentioned in this comment? |
|
Grey—the regular primary/default button, not green success. This follows the explicit design clarification, and the updated appearance was subsequently approved. The initial test step mentioning “green” is outdated. |
|
@MelvinBot Please update the test steps to include this #106136 (comment) |
|
Updated test step 3 to expect a grey “Reset filters” button using the regular primary/default style, not green success. QA inherits this through “Same as Tests steps.” |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.36-0 🚀
Bundle Size Analysis (Sentry): |







Explanation of Change
Add a primary “Reset filters” action to every “Nothing to show” search empty state, including Insights. The empty state and filter bar share the existing reset condition and navigation action so they stay consistent with view defaults. Other onboarding, travel, and celebratory empty states keep their existing actions.
AI Tests
shouldShowResetFiltersto menu empty-state metadata, enabled for Insights, and removed the title-key comparison. Regression tests cover true/false/omitted flags and title independence.prettierscript is absent and targeted formatter execution was denied. Initial broad checks also timed out before narrower retries passed as listed above.npm run fmtto the empty-search UI test; a second formatter run produced no unstaged diff.prettierscript does not exist;fmtis the repository's formatter.origin/because the workflow base ref is empty; the attempted base-ref override was denied by the execution policy.prettiernpm script does not exist in this checkout; a targeted formatter invocation was denied by the execution policy.Fixed Issues
$ #106053
PROPOSAL:
Tests
zzzz)Offline tests
N/A. Applying filters offline shows the offline screen.
QA Steps
Same as Tests steps.
PR Author Checklist
Checklist boxes checked on behalf of
ahmedGaber93at their request; this is not additional AI test verification. Existing AI test limitations remain recorded above and in the verification comments.### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web: button-style follow-up (blocked)
The supplied session rendered a blank page. This is blocker evidence, not proof of the feature passing.
Web: explicit reset-flag follow-up (blocked)
The supplied session rendered a blank page; this is blocker evidence, not proof of the feature passing.
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
AI verification evidence only — both viewports were blocked by a blank page, not successful feature verification.